import 'package:flutter/material.dart';

import '../routes.dart';

class RegisterPage extends StatefulWidget {
  const RegisterPage({super.key});

  @override
  State<RegisterPage> createState() => _RegisterPageState();
}

class _RegisterPageState extends State<RegisterPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('注册'),
        ),
        body: SafeArea(
            minimum: const EdgeInsets.all(28),
            child: Column(
              children: [
                const TextField(
                  decoration:
                      InputDecoration(labelText: '用户名', hintText: '请输入用户名'),
                ),
                const Padding(padding: EdgeInsets.all(10)),
                const TextField(
                    obscureText: true,
                    decoration:
                        InputDecoration(labelText: '密码', hintText: '请输入密码')),
                const Padding(padding: EdgeInsets.all(10)),
                const TextField(
                    obscureText: true,
                    decoration: InputDecoration(
                        labelText: '确认密码', hintText: '请再次输入密码')),
                const Padding(padding: EdgeInsets.all(10)),
                SizedBox(
                  width: double.maxFinite,
                  child: TextButton(
                    style: const ButtonStyle(
                        backgroundColor:
                            MaterialStatePropertyAll(Colors.green)),
                    onPressed: () {
                      //
                    },
                    child: const Text(
                      '注册',
                      style: TextStyle(color: Colors.white),
                    ),
                  ),
                ),
                const Padding(padding: EdgeInsets.all(10)),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    const Text('已有帐户，'),
                    TextButton(
                        onPressed: () {
                          //
                          Navigator.pushReplacementNamed(context, Routes.login);
                        },
                        child: const Text('去登录~'))
                  ],
                )
              ],
            )));
  }
}
